package com.gzx.risk.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum RiskNodes {

    RISK_ONE(1, "RISK_ONE"),
    RISK_TWO(2, "RISK_TWO"),
    ;

    private final int code;

    private final String desc;

    public static RiskNodes getByCode(int code) {
        for (RiskNodes nodes : values()) {
            if (nodes.code == code) {
                return nodes;
            }
        }
        return null;
    }
}